package Homework;

public class CalcThread extends Thread {
	SharedArea shearedArea;
	
	public CalcThread(SharedArea shearedArea) {
		this.shearedArea = shearedArea;
	}
	
	@Override
	public void run() {
		double total = 0.0;
		for(int cnt = 1; cnt<1000000000;cnt += 2){
			if(cnt/2%2 ==0){
				shearedArea.Pi += 4.0/cnt;
			}else{
				shearedArea.Pi += 4.0/cnt;
			}
		}
		shearedArea.Pi = total;
		shearedArea.done = true;
	}
}
